package virtualstock.util;

import java.math.BigDecimal;

public class RankEntry implements Comparable{
	private Long playerID;
	private String lastName;
	private String firstName;
	private BigDecimal portfolioValue;
	
	public Long getPlayerID() {
		return playerID;
	}
	public void setPlayerID(Long playerID) {
		this.playerID = playerID;
	}
	public String getLastName() {
		return lastName;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public BigDecimal getPortfolioValue() {
		return portfolioValue;
	}
	public void setPortfolioValue(BigDecimal portfolioValue) {
		this.portfolioValue = portfolioValue;
	}
	
	public RankEntry(Long id, String lastName, String firstName, BigDecimal value){
		this.playerID = id;
		this.lastName = lastName;
		this.firstName = firstName;
		this.portfolioValue = value;
	}
	@Override
	public int compareTo(Object other){
		RankEntry temp = (RankEntry)other;
		return this.portfolioValue.compareTo(temp.portfolioValue)*(-1);
	}
	
	@Override
	public String toString(){
		return this.playerID + " " + this.firstName + " " + this.lastName + " " + this.portfolioValue.toString(); 
	}
}
